<!DOCTYPE html>
<!-- saved from url=(0027)http://www.hnjyxh.com/zcfg/ -->
<html>
<head lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <title>作品上传-征集|写“酒”字赢美酒-中国·长沙酒文化节</title>
    <meta name="keywords" content="湖南省酒业协会 酒协 湖南酒业">
    <meta name="description" content="湖南省酒业协会">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="__STATIC__/home/jquery_weui/css/weui.min.css"/>
    <link rel="stylesheet" href="__STATIC__/home/jquery_weui/css/jquery-weui.min.css"/>
    {css href="__PUBLIC__static/home/css/jquery.jcrop.min.css"}
</head>
<body>
<form>
<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="text" name="username" placeholder="请输入姓名">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd">
            <label class="weui-label">手机号</label>
        </div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="tel" name="mobile" placeholder="请输入手机号">
        </div>
    </div>
</div>
<div class="weui-cells weui-cells_form" style="margin-top: 0">
    <div class="weui-cell">
        <div class="weui-cell__bd">
            <div class="weui-uploader">
                <div class="weui-uploader__hd">
                    <p class="weui-uploader__title">图片上传</p>
                </div>
                <div class="weui-uploader__bd">
                    <ul class="weui-uploader__files" id="uploaderFiles">
                    </ul>
                    <div class="weui-uploader__input-box">
                        <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple="">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="weui-cells__title" style="color: #000;">酒字真意</div>
<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__bd">
            <textarea class="weui-textarea" placeholder="请输入这幅作品的灵感来源、寓意、字体等信息" rows="3" name="msg"></textarea>
        </div>
    </div>
    <div class="weui-cells__tips">最多保存255个字符，谢谢！！</div>
</div>
</form>
<div class="demos-content-padded" style="padding: 15px;">
    <a href="javascript:;" class="weui-btn weui-btn_primary send_form">提交作品</a>
</div>


<script src="__STATIC__/home/jquery_weui/js/jquery-2.1.4.js"></script>
<script src="__STATIC__/home/jquery_weui/js/jquery-weui.min.js"></script>
{js href="__PUBLIC__static/home/js/jquery.jcrop.min.js" /}
{js href="__PUBLIC__static/home/js/jquery.jcrop.upload.js" /}
{js href="__PUBLIC__static/home/js/exif.js" /}
<script>
    var SCOPE = {};
    SCOPE.upload_img_max_num = 3;
    SCOPE.upload_img_url = "{:url('base/upload_image')}";

    $(function () {
        $(".send_form").click(function () {
            // 检查数据
            if (!$('input[name="username"]').val()) {
                $('input[name="username"]').focus();
                $.toptip('请输入您的姓名', 'error');
                return false;
            }

            if (!$('input[name="mobile"]').val()) {
                $('input[name="mobile"]').focus();
                $.toptip('请输入您的手机号码', 'error');
                return false;
            }

            if (!$('input[name="mobile"]').val().match(/^1[3|4|5|7|8][0-9]\d{4,8}$/i)) {
                $.toptip('手机号码格式不正确', 'error');
                $('input[name="mobile"]').focus();
                return false;
            }

            if ($('#uploaderFiles').find('li').length == 0) {
                $.toptip('至少上传一张图片', 'error');
                return false;
            }

            if (!$('textarea').val()) {
                $('textarea').focus();
                $.toptip('请输入作品描述信息', 'error');
                return false;
            }

            $.ajax({
                type : 'POST',
                url : '{:url("zjjz_form")}',
                data : $('form').serialize(),
                dataType : 'json',
                success : function(msg) {
                    if (msg.code == 1) {
                        $.toptip(msg.msg, 'success');
                        setTimeout(function () {
                            window.location.reload();
                        }, 888);
                    } else {
                        $.toptip(msg.msg, 'error');
                    }
                }
            });
        });
    });
</script>
</body>
</html>